@extends('orange.layouts.indexPublic')
@section('title',Site::get('hometitle'))
{{--首页css--}}
@section('headcss')
    <meta name="keywords" content="{{Site::get('homekeywords')}}">
    <meta name="description" content="{{Site::get('homedescription')}}">
    @parent
    <link rel="stylesheet" href="{{asset('/orange/css/index/index.css')}}">
    <link rel="stylesheet" href="{{asset('/vendor/swiper/skin/swiper2.7.6.css')}}">
@endsection

{{--主体内容--}}
@section('content')
    {{--logo、搜索栏--}}
    <div class="logoAndSearch">
        <div class="wrapper">
            <h1 class="logo">
                <a href="{{url('/')}}">
                    <img src="{{asset('orange/images/logo/logo_orange.png')}}">
                </a>
            </h1>
            <form class="search" action="{{url('job')}}" method="post">
                {!! csrf_field() !!}
                <div class="searchCont">
                    <input type="hidden" value="" id="keyword_type" name="keyword_type">
                    <div id="keyword_type_select" class="select"><span><a></a></span><i></i></div>
                    <input type="text" name="keyword" id="keyword" placeholder="搜一搜总有适合你的工作"/>
                    <button type="submit">搜索</button>
                </div>
                {{--热门关键字--}}
                <div class="hotKeywords">
                    <span>热门关键字：</span>
                    <a href="javascript:void(0)">销售经理</a>
                    <a href="javascript:void(0)">销售代表</a>
                    <a href="javascript:void(0)">会计</a>
                </div>
            </form>
            <div class="others">
                <div class="classify">
                    <a href="{{mainUrl('/personal/welcome')}}">分类搜索</a>
                    <div id="moreSearch_option" class="moreSearch hide">
                        <i class="smallAngle"></i>
                        <ul class="items">
                            <li><a href="{{url('/job')}}">最新工作</a></li>
                            <li><a href="{{url('/personal/accurate_search')}}">全能搜索</a></li>
                            <li><a href="{{url('/personal/recommended_post')}}">推荐的职位</a></li>
                        </ul>
                    </div>
                </div>
                <div class="searchByMap"><a href="{{url('/job?map_show=1')}}">地图查找</a></div>
                {{--<div class="register"><a href="{{url('personal/resume_mange')}}" class="regbtn">创建简历</a></div>--}}
            </div>
        </div>
    </div>
    {{--logo、搜索栏结束--}}

    {{--主导航--}}
    @include('orange.layouts.mainNav')
    {{--主导航结束--}}

    {{--主要内容--}}
    <div class="main">
        <div class="wrapper">
            {{--顶部分类列表以及广告图--}}
            <div class="mainTop">
                <dl class="categories">
                    <dt>全部分类</dt>
                    @foreach($position as $k=> $v)
                    <dd class="dd{{$k}}"><span></span><i></i>{{msubstr($v['value'],0,8)}}</dd>
                    @endforeach
                </dl>
                <div class="cateList hide">
                    @foreach($positionAllThree as $v)
                        <div class="childCate hide" >
                            @foreach($v['secondPosition'] as $vv)
                                <dl>
                                    <dt>{{$vv['value']}}</dt>
                                    <dd>
                                        @foreach($vv['thirdPosition'] as $vvv)
                                            <a href="{{url('job'.'?jobsort1='.$vvv['text'])}}" target="_blank">{{$vvv['value']}}</a>
                                        @endforeach
                                    </dd>
                                </dl>
                            @endforeach
                        </div>
                    @endforeach
                </div>
                {{--广告轮播图--}}
                <div class="banner">
                    <div class="swiper-container">
                        @if(count($loginT1) > 0)
                            <ul class="swiper-wrapper">
                                @foreach($loginT1 as $v)
                                    <li class="swiper-slide swiper-no-swiping">
                                        <a alt="{{$v->title}}" href="{{$v->ad_url}}" target="_blank"><img src="{{$v->pic_url}}"></a>
                                    </li>
                                @endforeach
                            </ul>
                        @else
                            <ul class="swiper-wrapper">
                                <li class="swiper-slide swiper-no-swiping">您还没有添加广告图！</li>
                            </ul>
                        @endif
                    </div>
                    <div class="play-mid-btn play-mid-BL"></div>
                    <div class="play-mid-btn play-mid-BR"></div>
                </div>
                {{--广告轮播图结束--}}

                {{--个人、企业登录--}}
                <div class="login">
                    {{--判断有没有登录前台--}}
                    @if(auth()->guard('personal')->check())
                        <div class="loggedIn">
                            <p>欢迎您，<span class="username">{{ str_limit((auth()->guard('personal')->user()->username?:auth()->guard('personal')->user()->mobile),8)}}</span></p>
                            <span class="logout"><a href="{{url('personal/logout')}}">退出</a></span>
                        </div>
                        <div class="loggedInfo">
                            <a href="{{url('personal/resume_mange')}}"><i class="pos resumeManage"></i><span>简历管理</span></a>
                            <a class="noBorderRight" href="{{url('personal/resume_refresh')}}"><i class="refresh"></i><span>刷新简历</span></a>
                            <a href="{{url('personal/interview')}}"><strong>{{$interview_count}}</strong><span>面试邀请</span></a>
                            <a class="noBorderRight" href="{{url('personal/browse_resume')}}"><strong>{{$browse_resume_count}}</strong><span>谁看过我</span></a>
                        </div>
                        <div class="accountCenter"><a href="{{url('personal/welcome')}}">账户中心</a></div>
                    @elseif(auth()->guard('company')->check())
                        <div class="loggedIn">
                            <p>欢迎您，<span class="username">{{msubstr(auth()->guard('company')->user()->username,0,8)}}</span></p>
                            <span class="logout"><a href="{{url('company/logout')}}">退出</a></span>
                        </div>
                        <div class="loggedInfo">
                            <a href="{{url('company/jobadmin')}}"><i class="pos"></i><span>职位管理</span></a>
                            <a class="noBorderRight" href="{{url('company/welcome?refreshtip=yes')}}"><i class="refresh"></i><span>刷新职位</span></a>
                            <a href="{{url('company/jobpublish')}}"><strong>{{$companyJobCount}}</strong><span>发布职位</span></a>
                            <a class="noBorderRight" href="{{url('company/resume_message')}}"><strong>{{$resumeSendCount}}</strong><span>查收简历</span></a>
                        </div>
                        <div class="accountCenter"><a href="{{url('company/welcome')}}">账户中心</a></div>
                    @else
                        <div class="loginSwitch">
                            <a class="active" href="javascript:void(0)" data-a-text="personal">个人登录</a>
                            <a href="javascript:void(0)" data-a-text="company">企业登录</a>
                        </div>
                        {{--个人登录--}}
                        <form class="personal" action="{{url('personal/welcome')}}" onsubmit="return checkPersonal('#personalForm')" method="post" id="personalForm"  name="personalForm">
                            {!! csrf_field() !!}
                            <input type="text" name="username" id="username" value="" placeholder="个人用户名" autocomplete="off">
                            <input type="password" name="password" id="password"  value="" placeholder="密码" autocomplete="off">
                            <div class="autoAndGetBack">
                                <input class="autoLogin" id="autoLogin" type="checkbox" name="remember"><label for="autoLogin">自动登录</label>
                                <a href="{{url('personal/find_password')}}">忘记密码？</a>
                            </div>
                            <button type="submit">登录</button>
                            @if(!empty(Site::get('personAppid')))
                                <div class="othersLogin">
                                    <p><em></em>第三方登录<em></em></p>
                                    <div class="box">
                                        <a class="qq" href="{{ url("personal/qqlogin") }}"></a>
                                        {{--<a class="wx" href="{{ weiXinlogin('personal') }}"></a>--}}
                                    </div>
                                </div>
                            @endif
                        </form>
                        {{--企业登录--}}
                        <form class="company hide" action="{{url('company/welcome')}}" method="post" onsubmit="return checkCompany('#companyForm')" id="companyForm"  name="companyForm">
                            {!! csrf_field() !!}
                            <input type="text" name="username" id="username" placeholder="企业用户名" autocomplete="off">
                            <input type="password" name="password" id="password" placeholder="密码" autocomplete="off">
                            <div class="autoAndGetBack">
                                <input class="autoLogin" id="autoLogin" type="checkbox" name="remember"><label for="autoLogin">自动登录</label>
                                <a href="{{url('company/find_password')}}">忘记密码？</a>
                            </div>
                            <button type="submit">登录</button>
                            @if(!empty(Site::get('CompanyAppid')))
                                <div class="othersLogin">
                                    <p><em></em>第三方登录<em></em></p>
                                    <div class="box">
                                        <a class="qq" href="{{ url("company/qqlogin") }}"></a>
                                        {{--<a class="wx" href="{{ weiXinlogin('company') }}"></a>--}}
                                    </div>
                                </div>
                            @endif
                        </form>
                    @endif
                </div>
                {{--个人、企业登录结束--}}

                <div class="brand">
                    <?php $i = 0;?>
                    @if(count($mingP) > 0)
                        @foreach($mingP as $v)
                            @if($i < 8)
                                <a href="{{$v->ad_url}}" target="_blank"><img src="{{$v->pic_url}}" alt="" width="223" height="104"></a>
                            @endif
                            <?php $i++;?>
                        @endforeach
                    @else
                        <a href="javascript:void(0)"><img src="" alt=""></a>
                        <a href="javascript:void(0)"><img src="" alt=""></a>
                        <a href="javascript:void(0)"><img src="" alt=""></a>
                        <a href="javascript:void(0)"><img src="" alt=""></a>
                        <a href="javascript:void(0)"><img src="" alt=""></a>
                        <a href="javascript:void(0)"><img src="" alt=""></a>
                        <a href="javascript:void(0)"><img src="" alt=""></a>
                        <a href="javascript:void(0)"><img src="" alt=""></a>
                    @endif
                </div>
            </div>
            {{--顶部分类列表以及广告图结束--}}

            {{--推荐公司以及简历--}}
            <div class="recommendCont">
                <div class="companies">
                    <h2><span>推荐公司</span><a href="javascript:void(0)">更多 ></a></h2>
                    <ul>
                        <li>
                            <div class="compInfo">
                                <span class="compIcon"></span>
                                <a class="title">浙江永泰隆股份有限公司</a>
                                <p ><span class="icon_address"></span>椒江区</p>
                                <p><span class="icon_employees"></span>500人</p>
                                <p><span class="icon_industry"></span>名营企业</p>
                            </div>
                            <div class="data">
                                <p><span>2个</span><span class="dataName">在招职位</span></p>
                                <p><span>56%</span><span class="dataName">简历回复率</span></p>
                                <p><span>1天</span><span class="dataName">企业最近登录</span></p>
                            </div>
                        </li>
                        <li class="noMarginRight">
                            <div class="compInfo">
                                <span class="compIcon"></span>
                                <a class="title">浙江永泰隆股份有限公司</a>
                                <p ><span class="icon_address"></span>椒江区</p>
                                <p><span class="icon_employees"></span>500人</p>
                                <p><span class="icon_industry"></span>名营企业</p>
                            </div>
                            <div class="data">
                                <p><span>2个</span><span class="dataName">在招职位</span></p>
                                <p><span>56%</span><span class="dataName">简历回复率</span></p>
                                <p><span>1天</span><span class="dataName">企业最近登录</span></p>
                            </div>
                        </li>
                        <li>
                            <div class="compInfo">
                                <span class="compIcon"></span>
                                <a class="title">浙江永泰隆股份有限公司</a>
                                <p ><span class="icon_address"></span>椒江区</p>
                                <p><span class="icon_employees"></span>500人</p>
                                <p><span class="icon_industry"></span>名营企业</p>
                            </div>
                            <div class="data">
                                <p><span>2个</span><span class="dataName">在招职位</span></p>
                                <p><span>56%</span><span class="dataName">简历回复率</span></p>
                                <p><span>1天</span><span class="dataName">企业最近登录</span></p>
                            </div>
                        </li>
                        <li class="noMarginRight">
                            <div class="compInfo">
                                <span class="compIcon"></span>
                                <a class="title">浙江永泰隆股份有限公司</a>
                                <p ><span class="icon_address"></span>椒江区</p>
                                <p><span class="icon_employees"></span>500人</p>
                                <p><span class="icon_industry"></span>名营企业</p>
                            </div>
                            <div class="data">
                                <p><span>2个</span><span class="dataName">在招职位</span></p>
                                <p><span>56%</span><span class="dataName">简历回复率</span></p>
                                <p><span>1天</span><span class="dataName">企业最近登录</span></p>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="resumes">
                    <h2><span>推荐简历</span><a href="javascript:void(0)">更多 ></a></h2>
                    <ul>
                        <li>
                            <span class="avatar"></span>
                            <p class="p1"><a href="javascript:void(0)">詹丹丹</a>UI设计</p>
                            <p>台州<i class="vline"></i>1-2年<i class="vline"></i>本科</p>
                        </li>
                        <li>
                            <span class="avatar"></span>
                            <p class="p1"><a href="javascript:void(0)">詹丹丹</a>UI设计</p>
                            <p>台州<i class="vline"></i>1-2年<i class="vline"></i>本科</p>
                        </li>
                        <li>
                            <span class="avatar"></span>
                            <p class="p1"><a href="javascript:void(0)">詹丹丹</a>UI设计</p>
                            <p>台州<i class="vline"></i>1-2年<i class="vline"></i>本科</p>
                        </li>
                        <li>
                            <span class="avatar"></span>
                            <p class="p1"><a href="javascript:void(0)">詹丹丹</a>UI设计</p>
                            <p>台州<i class="vline"></i>1-2年<i class="vline"></i>本科</p>
                        </li>
                        <li>
                            <span class="avatar"></span>
                            <p class="p1"><a href="javascript:void(0)">詹丹丹</a>UI设计</p>
                            <p>台州<i class="vline"></i>1-2年<i class="vline"></i>本科</p>
                        </li>
                    </ul>
                </div>
            </div>
            {{--推荐公司以及简历结束--}}

            {{--热门职位--}}
            <div class="hotJobs">
                <h2><span>热门职位</span></h2>
                <ul>
                    <li>
                        <div class="left">
                            <p class="left-p1"><a href="">诚聘业务销售</a><span>2017-03-02</span></p>
                            <p class="left-p2"><strong>4000-6000</strong>台州<i class="vline"></i>1-2年</p>
                            <p class="left-p3"><span>双休</span><span>餐补</span><span>五险</span></p>
                        </div>
                        <div class="right">
                            <p class="right-p1"><a href="">爱看云解析科技有限公司</a></p>
                            <p class="right-p2">互联网、电子商务</p>
                            <p class="right-p3">少于50人</p>
                        </div>
                    </li>
                    <li>
                        <div class="left">
                            <p class="left-p1"><a href="">诚聘业务销售</a><span>2017-03-02</span></p>
                            <p class="left-p2"><strong>4000-6000</strong>台州<i class="vline"></i>1-2年</p>
                            <p class="left-p3"><span>双休</span><span>餐补</span><span>五险</span></p>
                        </div>
                        <div class="right">
                            <p class="right-p1"><a href="">爱看云解析科技有限公司</a></p>
                            <p class="right-p2">互联网、电子商务</p>
                            <p class="right-p3">少于50人</p>
                        </div>
                    </li>
                    <li>
                        <div class="left">
                            <p class="left-p1"><a href="">诚聘业务销售</a><span>2017-03-02</span></p>
                            <p class="left-p2"><strong>4000-6000</strong>台州<i class="vline"></i>1-2年</p>
                            <p class="left-p3"><span>双休</span><span>餐补</span><span>五险</span></p>
                        </div>
                        <div class="right">
                            <p class="right-p1"><a href="">爱看云解析科技有限公司</a></p>
                            <p class="right-p2">互联网、电子商务</p>
                            <p class="right-p3">少于50人</p>
                        </div>
                    </li>
                    <li class="more"><a href="javascript:void(0)">更多 ></a></li>
                </ul>
            </div>
            {{--热门职位结束--}}

            {{--最新资讯--}}
            <div class="news">
                <h2><span>最新资讯</span></h2>
                <ul>
                    <li><a href="javascript:void(0)">2017年大型招聘周开始啦</a></li>
                    <li><a href="javascript:void(0)">关于办理人才市场2017年度会</a></li>
                    <li><a href="javascript:void(0)">2017年大型招聘周开始啦</a></li>
                    <li><a href="javascript:void(0)">关于办理人才市场2017年度会</a></li>
                </ul>
            </div>
            {{--最新资讯结束--}}
        </div>
    </div>
    {{--主要内容--}}
    <?php
    ?>
@endsection
{{--首页js--}}
@section('js')
    @parent
    <script type="text/javascript" src="{{'/default/js/jquery/jquery.select.js'}}"></script>
    <script type="text/javascript" src="{{'/vendor/org/layer/layer.js'}}"></script>
    <script type="text/javascript" src="{{'/default/js/jquery/jquery.form.js'}}"></script>
    <script type="text/javascript" src="{{'/vendor/swiper/swiper2.7.6.min.js'}}"></script>
    <script type="text/javascript" src="{{asset('/orange/js/index/index.js')}}"></script>
    <script>
        var welcomeUrl = "{{ url('/personal/welcome') }}";
        var companyWelcomeUrl = "{{ url('/company/welcome') }}";
        var _token = "{{csrf_token()}}";
        var siteArea = {!!Site::getCity()->toJson()!!};

        $(function(){
            //全部分类列表鼠标移上事件
            $('.mainTop .categories').on('mouseenter.ddEnter','dd',function(){
                var index = $(this).index();
                $('.mainTop .cateList').removeClass('hide');
                $('.mainTop .cateList .childCate').addClass('hide').eq(index - 1).removeClass('hide')
                        .on('mouseleave.childCateLeave',function(){
                            $(this).addClass('hide').off('.childCateLeave').parent().addClass('hide');
                });
                //删除绑定事件
                $(this).off('.ddEnter');
            });
            //全部分类列表鼠标移开事件
            $('.mainTop .categories').on('mouseleave.ddLeave','dd',function(){
                var index = $(this).index();
                $('.mainTop .cateList').addClass('hide');
                $('.mainTop .cateList .childCate').addClass('hide');
                $('.mainTop .cateList .childCate').addClass('hide').eq(index - 1)
                        .on('mouseenter.childCateEnter',function(){
                            $(this).removeClass('hide').off('.childCateEnter').parent().removeClass('hide');
                });
                $(this).off('.ddLeave');
            });

            //搜索栏中搜索条件选择
            $('.logoAndSearch select.select').select();

            //登录框中登录对象切换
            $('.login .loginSwitch').on('click','a',function(){
                var $that = $(this);
                var data = $that.attr('data-a-text');
                $that.addClass('active').siblings().removeClass('active');
                if(data == 'personal'){
                    $('.login .' + data).removeClass('hide').next().addClass('hide');
                }else if(data == 'company'){
                    $('.login .' + data).removeClass('hide').prev().addClass('hide');
                }
            });

            //广告轮播图
            var mySwiper = new Swiper('.mainTop .banner .swiper-container',{
                autoplay : 3000,//可选选项，自动滑动
                loop : true,//可选选项，开启循环
                noSwiping: true, //可选选项，禁止点击滑动
                paginationClickable :true //可选选项，开启分页器点击功能
            });
            $('.banner .swiper-slide').mouseenter(function(){
                mySwiper.stopAutoplay();
                $(this).mouseleave(function(){
                    mySwiper.startAutoplay();
                });
            });
            $('.banner .play-mid-btn').mouseenter(function(){
                mySwiper.stopAutoplay();
                $(this).click(function(){
                    if($(this).hasClass('play-mid-BL')){
                        mySwiper.swipePrev();
                    }else{
                        mySwiper.swipeNext();
                    }
                });
                $(this).mouseleave(function(){
                    mySwiper.startAutoplay();
                });
            });
        });
    </script>
@endsection